/*******************************************************************
 *   > File Name: DxInput_Key.c
 *   > Author: fly
 *   > Mail: lf.ye@samoon.net
 *   > Create Time: 2020年08月05日 星期三 15时35分26秒
 *================================================================*/
#include "key.h"
#include "KeyDef.h"
#include "stdio.h"
#include "main.h"

void DrvKey_DetKeyDelay(void)
{
	delay(10);
}
 
unsigned int DrvKey_DetNormalKey(void)
{
	unsigned int uiKeyCode = 0;
	
	if (!leftKey_value()){
		uiKeyCode |= FLGKEY_LEFT;
        printf("---->FLGKEY_LEFT\n\r");
	}
	
	if (!rightKey_value()){
		uiKeyCode |= FLGKEY_RIGHT;
        printf("---->FLGKEY_RIGHT\n\r");
	}
	
	if (!upKey_value()){
		uiKeyCode |= FLGKEY_UP;
        printf("---->FLGKEY_UP\n\r");
	}
	
	if (!downKey_value()){
		uiKeyCode |= FLGKEY_DOWN;
        printf("---->FLGKEY_DOWN\n\r");
	}
	
	if (!backKey_value()){
		uiKeyCode |= FLGKEY_BACK;
        printf("---->FLGKEY_BACK\n\r");
	}
	
	if (!menuKey_value()){
		uiKeyCode |= FLGKEY_MENU;
        printf("---->FLGKEY_MENU\n\r");
	}

	DrvKey_DetKeyDelay();
    return uiKeyCode;
}
